﻿@model KL.Store.Web.Models.ProductEditModel
@using KL.Store.Core;
@using CaptchaMvc.HtmlHelpers;
@{
    Layout = "~/Views/Shared/_LayoutBasic.cshtml";
    ViewBag.Title = "Edit";
    //Html.EnableClientValidation(false);
    var ToEdit = ViewBag.ToEdit;
}
<h2 style="display: inline-block;">Ürün Düzenle</h2>
@{Html.RenderAction("EditMenu", "Product", new { productId = Model.ProductId, toEdit = ToEdit });}
<hr />
@if (ToEdit == "EditInfo")
{
    Html.RenderAction("EditInfo", "Product", new { id = Model.ProductId });
}
else if (ToEdit == "EditProperties")
{
    Html.RenderAction("EditProperties", "Product", new { productId = Model.ProductId });
}
else if (ToEdit == "ProductMetaEdit")
{
    Html.RenderAction("ProductMetaEdit", "Product", new { id = Model.ProductId });
}

<script>
    function urunKaydedildi()
    {
        alert('Bilgiler Kaydedildi.');
        var answer = confirm("Sayfa yenilensin mi?")
        if (answer)
        {
            parent.location.reload(true);
        }
    }
    function hataMesaji(mesaj)
    {
        alert(mesaj);
    }
    $('#closeForm').click(function ()
    {
        parent.$.fancybox.close();
    });
    $('#productedit').bind("keyup keypress", function (e)
    {
        var code = e.keyCode || e.which;
        if (code == 13)
        {
            e.preventDefault();
            return false;
        }
    });
</script>
